import sun.security.util.Password;

import javax.lang.model.element.NestingKind;
import java.util.Scanner;

class UserNameError extends Exception{
    public UserNameError(String message){
        super(message);
    }
}
class PasswordError extends Exception{
    public PasswordError(String message){
        super(message);
    }
}
public class Login {
    private static String userName="me";

    private static String Password="123456";

    public static void loginInfo(String user,String password)throws UserNameError,PasswordError{

        if(!user.equals(userName)){
                throw new UserNameError("用户名错误");
            }
            if(!password.equals(Password)){
                throw new PasswordError("密码错误");
            }
            System.out.println("登录成功");

    }

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String user=sc.nextLine();
        String password=sc.nextLine();
        try {

            loginInfo(user,password);

        } catch (UserNameError e) {
            e.printStackTrace();


        } catch (PasswordError e) {
            e.printStackTrace();
        }

    }


}

//public class Login{
//    private static String userName="me";
//    private static String Password="123456";
//
//    public static void loginInfo(String userName,String password){
//
//        if(!userName.equals(userName)){
//
//        }
//        if(!password.equals(password)){
//
//        }
//        System.out.println("登录成功");
//    }
//
//    public static void main(String[] args) {
//        loginInfo("me","123456");
//    }
//}

